@include('admin.header')
<link rel="stylesheet" href="/static/admin/bootstrap/css/bootstrap.min.css">
<style>
    .span_type {
        color: orange;
    }

    .span_amount {
        color: blue;
    }
</style>

<div class="container-fluid">

    <!-- 订单详情 -->
    <div class="col-md-12" style="margin-bottom: 20px;">
        <table class="table table-striped table-hover">
            <caption>订单信息</caption>
            <tr class="info">
                <th>订单ID号</th>
                <th>订单编号</th>
                <th>用户手机号</th>
                <th>推荐人手机号</th>
                <th>支付方式</th>
                <th>订单PV</th>
                <th>是否支付成功</th>
                <th>支付时间</th>
            </tr>
            <tr>
                <td>{{$data->order_id}}</td>
                <td>{{$data->order_no}}</td>
                <td>{{$data->nodename}}</td>
                <td>{{$data->introducer}}</td>
                <td>
                    @foreach($data->pay_detail as $val)
                        <div><span class="span_type">{{$val['Remarks']}}:</span><span class="span_amount">{{$val['PayAmount']/100}}</span></div>
                    @endforeach
                </td>
                <td>{{$data->order_pv}}</td>
                <td>
                    @if($data->status == 1)
                        是
                    @else
                        否
                    @endif
                </td>
                <td>{{$data->pay_time}}</td>
            </tr>
        </table>
    </div>

    <!-- 商品信息 -->
    <div class="col-md-6">
        <table class="table table-striped table-hover">
            <caption>商品信息</caption>
            <tr class="success">
                <th>商品名称</th>
                <th>商品价格</th>
                <th>商品属性</th>
            </tr>
            @foreach($order_detail as $val)
                <tr>
                    <td>{{$val->product_name}}</td>
                    <td>{{$val->price}}</td>
                    <td>{{$val->remarks}}</td>
                </tr>
            @endforeach
        </table>
    </div>

    <div class="margin:5px;"></div>

    <!-- 收货地址 -->
    <div class="col-md-6">
        <table class="table table-striped table-hover">
            <caption>收货地址</caption>
            <tr class="success">
                <th>国家</th>
                <th>省份</th>
                <th>城市</th>
                <th>区</th>
                <th>详细地址</th>
            </tr>
            <tr>
                @if($consignee)
                <td>{{$consignee->country}}</td>
                <td>{{$consignee->province}}</td>
                <td>{{$consignee->city}}</td>
                <td>{{$consignee->region}}</td>
                <td>{{$consignee->address}}</td>
                @endif
            </tr>
        </table>
    </div>
</div>

<script>
    $(function () {
        $('.direct_add_form').submit(function(){
            var $t = $(this),action=$t.attr('action'),data = $t.serialize();
            post(action,data,function(data){
                _alert('处理成功',function(){
                    parent.location.reload();
                    parent.layer.close(parent.layer_open2);
                });
            });
            return false;
        });
    });
</script>